import random
lst = [1,4,9,16,2,5,10,15]
#lst1 = []
d1 = {}
for i in range(20):
    rand_num1 = random.randint(1, 20)
    if rand_num1 not in d1.keys():
#    if rand_num1 not in lst1:
#        lst1.append(rand_num1)
        d1[rand_num1] = 1
    else:
        d1[rand_num1] +=1
lst2 = sorted(d1.items(), key=lambda item: item[1],reverse=True)
for i in range(3):
    print(lst2[i])

# 完成的不错
